package com.ywh.hilttest.test4

import javax.inject.Inject

/**
 * 一个对象有多个子类，我们怎么让hilt知道我们要子类
 */
abstract class Engine {
    abstract fun name(): String
}

class CarEngine @Inject constructor() : Engine() {
    override fun name(): String = "汽车引擎"
}


class TrainEngine @Inject constructor(): Engine() {
    override fun name(): String = "火车引擎"
}